import 'package:flutter/material.dart';
import 'package:flutter_base/common/routeUtil.dart';
import 'package:flutter_base/widgets/commonWidgets.dart';
import 'package:flutter_base/widgets/textWidgets.dart';

/// Create： Zhang 2021/6/28 10:52 上午
/// erp:     ext.zhangjunfei
/// 描述：列表item

Widget itemWidget(
  BuildContext context, {
  required String text,
  VoidCallback? onClick,
}) {
  return InkWell(
    splashColor: Colors.transparent,
    highlightColor: Colors.transparent,
    onTap: () {
      if (onClick != null) {
        onClick();
      }
    },
    child: cardView(
      margin: EdgeInsets.only(left: 15, right: 15, top: 5, bottom: 5),
      padding: EdgeInsets.only(left: 15, right: 15, top: 20, bottom: 20),
      isShowShadow: false,
      child: Row(
        children: [
          FlutterLogo(size: 25),
          Expanded(
            child: commonText(
              text,
              fontSize: 14,
              margin: EdgeInsets.only(left: 10, right: 10),
            ),
          ),
          Icon(
            Icons.arrow_forward_ios_rounded,
            size: 20,
            color: const Color(0xff4F4F4F),
          )
        ],
      ),
    ),
  );
}
